package org.crazyit.activiti_d2._4_Count;

import org.activiti.engine.IdentityService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.identity.Group;

import java.util.List;

public class Count {

    public static void main(String[] args) {

        //1. 创建流程引擎
        ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

        //2. 得到身份服务组件实例
        IdentityService identityService = engine.getIdentityService();

        /*
            3. 调用count() 方法, 查询全部用户组数据量
            由于上一个类中已经写入了数据, 所以这边直接查询
         */
        long size = identityService.createGroupQuery().count();

        //4. 输出全部数据量
        System.out.println("Group 数量:" + size);

    }

}
